<?php include "../../classes.inc" ?>

<?php include "../../constants.inc" ?>

<?php session_start(); ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Tornooien</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="../../assets/css/default.css" rel="stylesheet" type="text/css">

<script language="JavaScript" src="../../assets/js/ajax.js" />

</script>

</head>



<body bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0" class="default">

<table border="0" cellpadding="0" cellspacing="0" width="100%">

    <tr>

        <td>

            <table border="0" cellpadding="0" cellspacing="0">

                <tr>

                    <td width="7">

                        <img src="../../assets/images/spacer.gif" height="1" width="7" ALT="">

                    </td>

                    <td width="150" align="left"><img src="../../assets/images/headerbar_kerst.gif" alt="" ></td>



                </tr>

                <tr>

                    <td colspan="2" height="12"><img src="../../assets/images/spacer.gif" alt="" height="12" width="1"></td>

                </tr>

            </table>

        </td>

        <td align="right" valign="top">

		<br/>

<?php

	mysql_connect(DB_SERVER, DB_USER, DB_PWD);

	mysql_select_db(DB_CATALOG);



    $result = mysql_query("SELECT club_id, team_name, team_nr FROM zt_team where department_nr = 1 order by club_id, team_nr");

	$teamListDpt1 = array();

	while ($row = mysql_fetch_assoc($result)) {

	    $team = new Team;

	    $team->club_id = $row['club_id'];

	    $team->team_name = $row['team_name'];

	    $team->team_nr = $row['team_nr'];

	    array_push($teamListDpt1, $team);

	}

	$maxListSize = count($teamListDpt1);



    $result = mysql_query("SELECT club_id, team_name, team_nr FROM zt_team where department_nr = 2 order by club_id, team_nr");

	$teamListDpt2 = array();

	while ($row = mysql_fetch_assoc($result)) {

	    $team = new Team;

	    $team->club_id = $row['club_id'];

	    $team->team_name = $row['team_name'];

	    $team->team_nr = $row['team_nr'];

	    array_push($teamListDpt2, $team);

	}



	if ( count($teamListDpt2) > $maxListSize ) {

		$maxListSize = count($teamListDpt2);

    }



    $result = mysql_query("SELECT club_id, team_name, team_nr FROM zt_team where department_nr = 3 order by club_id, team_nr");

	$teamListDpt3 = array();

	while ($row = mysql_fetch_assoc($result)) {

	    $team = new Team;

	    $team->club_id = $row['club_id'];

	    $team->team_name = $row['team_name'];

	    $team->team_nr = $row['team_nr'];

	    array_push($teamListDpt3, $team);

	}



    if ( count($teamListDpt3) > $maxListSize ) {

		$maxListSize = count($teamListDpt3);

    }



	mysql_free_result($result);



    if ( isset($_SESSION['user']) ) {

		$user = $_SESSION['user'];

?>

			<a href="../../logout.php?redirect=/tornooien/zt-php/view_players_list.php"><img src="../../assets/images/24x24/plain/exit.gif" border="0" alt="Log uit"></a>

			<br>&nbsp;<br>

			<span class="headerSmall">User <?=$_SESSION['user']->name?> logged in at <?=$user->login_date?>.</span>



<?php

	}

?>

</td>

		<td>&nbsp;</td>

	</tr>

</table>

<table border="0" cellpadding="0" cellspacing="0" width="100%" >

    <tr>

        <td align="left">

            <table border="0" cellpadding="0" cellspacing="0">

                <tr>

                    <td rowspan="2" width="7"><img src="../../assets/images/spacer.gif" alt="" height="1" width="7"></td>



					<td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_l.gif" height="14" width="14" ALT=""></td>

					<td nowrap rowspan="2" class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt="" height="3" width="3"><br/><a href="/newsbox.php" target="_top"><span class="tabName">Nieuwsbox</span></a></td>

					<td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_r.gif" height="14" width="14" ALT=""></td>

					<td rowspan="2" width=2><img src="../../assets/images/spacer.gif" alt="" height="1" width="2"></td>



					<td valign="top"><img src="../../assets/images/tabcorners/re_FFFFFF_l.gif" height="14" width="14" ALT=""></td>

                    <td nowrap rowspan="2" class="activeSpacer"><img src="../../assets/images/spacer.gif" alt="" height="3" width="3"><br/><a href="/tornooien/tornooien.html" target="_top"><span class="tabName">Tornooien</span></a></td>

                    <td valign="top"><img src="../../assets/images/tabcorners/re_FFFFFF_r.gif" height="14" width="14" ALT=""></td>

                    <td rowspan="2" width=2><img src="../../assets/images/spacer.gif" alt="" height="1" width="2"></td>



					<td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_l.gif" height="14" width="14" ALT=""></td>

                    <td nowrap rowspan="2" class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt="" height="3" width="3"><br/><a href="/bestuur/bestuur.php" target="_top"><span class="tabName">Bestuur</span></a></td>

                    <td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_r.gif" height="14" width="14" ALT=""></td>

                    <td rowspan="2" width=2><img src="../../assets/images/spacer.gif" alt="" height="1" width="2"></td>



					<td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_l.gif" height="14" width="14" ALT=""></td>

                    <td nowrap rowspan="2" class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt="" height="3" width="3"><br/><a href="/advalvas/index.html" target="_top"><span class="tabName">Ad Valvas</span></a></td>

                    <td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_r.gif" height="14" width="14" ALT=""></td>

                    <td rowspan="2" width=2><img src="../../assets/images/spacer.gif" alt="" height="1" width="2"></td>



					<td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_l.gif" height="14" width="14" ALT=""></td>

                    <td nowrap rowspan="2" class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt="" height="3" width="3"><br/><a href="http://www.frbe-kbsb.be/EloHist/FRBE_Fiche.php" target="_blank"><span class="tabName">ELO</span></a></td>

                    <td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_r.gif" height="14" width="14" ALT=""></td>

                    <td rowspan="2" width=2><img src="../../assets/images/spacer.gif" alt="" height="1" width="2"></td>



					<td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_l.gif" height="14" width="14" ALT=""></td>

                    <td nowrap rowspan="2" class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt="" height="3" width="3"><br/><a href="/clubs/clubs.php" target="_top"><span class="tabName">Clubs</span></a></td>

                    <td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_r.gif" height="14" width="14" ALT=""></td>

                    <td rowspan="2" width=2><img src="../../assets/images/spacer.gif" alt="" height="1" width="2"></td>



					<td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_l.gif" height="14" width="14" ALT=""></td>

                    <td nowrap rowspan="2" class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt="" height="3" width="3"><br/><a href="/jeugd/index.html" target="_top"><span class="tabName">Jeugd</span></a></td>

                    <td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_r.gif" height="14" width="14" ALT=""></td>

                    <td rowspan="2" width=2><img src="../../assets/images/spacer.gif" alt="" height="1" width="2"></td>



					<td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_l.gif" height="14" width="14" ALT=""></td>

                    <td nowrap rowspan="2" class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt="" height="3" width="3"><br/><a href="/links/index.php" target="_top"><span class="tabName">Links</span></a></td>

                    <td valign="top"><img src="../../assets/images/tabcorners/re_99CCFF_r.gif" height="14" width="14" ALT=""></td>

                    <td rowspan="2" width=2><img src="../../assets/images/spacer.gif" alt="" height="1" width="2"></td>

				</tr>

				<tr>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="activeSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="activeSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

					<td class="inactiveSpacer"><img src="../../assets/images/spacer.gif" alt=""></td>

				</tr>

			</table>

		</td>

	</tr>

	<tr>

		<td width="100%" bgcolor="#FFFFFF" colspan="13"><img border="0" width="30" src="../../assets/images/FFFFFF.gif" height="12" alt=""></td>

	</tr>

</table>



<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0" bgcolor="#FFFFFF">

	<tr>

		<td id="leftFiller" valign="top" height="100%" rowspan="3" bgcolor="#666666">

			<table border="0" cellpadding="0" cellspacing="0" height="100%" width="8px">

				<tr><td>&nbsp;</td></tr>

			</table>

		</td>

		<td id="header" valign="top" width="100%">

			<table border="0" width="100%" cellpadding="3" cellspacing="0" bgcolor="#10425b">

				<tr>

					<td bgcolor="#666666" width="40%">

						<span class="headerLarge">Tornooien</span>

						<br>

						<span class="headerMedium">Kalenders, spelerslijsten, rondeuitslagen en standen</span>

					</td>

					<td bgcolor="#666666" align="right" valign="top">&nbsp;



					</td>

				</tr>

			</table>

			<table align="center" border="0" width="100%" height="90%" cellpadding="0" cellspacing="0" style="border-top:#BCDD10 4px solid;">

				<tr>

					<td>&nbsp;</td>

					<td width="100%" height="20" colspan="2" class="quicklink">

						<a href="../tornooien.html">overzicht</a> |

						<a href="zt.php">zilveren toren</a> |

                        <a href="../individueel.html">individueel</a> |

						

						<a href="../elfnovember.html">11 november</a>

					</td>

				</tr>

				<tr><td colspan="2" nowrap bgcolor="#BCDD10" height="4"><img src="../../assets/images/spacer.gif" alt="" height="1" width="1"></td></tr>

				<tr>

					<td>&nbsp;</td>

					<td valign="top">

						<table align="left" cellspacing="10" width="100%">

							<tr>

								<td>

                                    <span class="blackHeaderLarge">Zilveren Toren 2007 - Ploeginschrijvingen</span>

									<br>&nbsp;<br>

									<table width="80%" border="0" cellpadding="2" cellspacing="0" class="solidYellowBox">

                                    	<?php

                                    		if (count($teamListDpt1) == 0 && count($teamListDpt2) == 0 && count($teamListDpt3) == 0) {

                                        ?>

                                        <tr>

											<td colspan="6"><strong>Op dit moment zijn er nog geen ploegen ingeschreven.</strong></td>

										</tr>

                                        <?php

                                            } else {

                                        ?>

                                        <tr>

                                        	<td align="center" width="33%" style="border-bottom:1px solid #A6C218;border-right:1px solid #A6C218;"><strong>Reeks 1</strong></td>

                                        	<td align="center" width="33%" style="border-bottom:1px solid #A6C218;border-right:1px solid #A6C218;"><strong>Reeks 2</strong></td>

                                        	<td align="center" width="33%" style="border-bottom:1px solid #A6C218;"><strong>Reeks 3</strong></td>

                                        </tr>

                                        <?php

                                                for ($i = 0; $i < $maxListSize; $i++) {

                                                    $team1 = new Team;

                                                    $team2 = new Team;

                                                    $team3 = new Team;

                                                	if (count($teamListDpt1) >= $i + 1) {

                                                    	$team1 = $teamListDpt1[$i];

                                                    }

                                                    if (count($teamListDpt2) >= $i + 1) {

                                                    	$team2 = $teamListDpt2[$i];

                                                    }

                                                    if (count($teamListDpt3) >= $i + 1) {

                                                    	$team3 = $teamListDpt3[$i];

                                                    }

                                        ?>

                                        <tr>

                                            <td style="border-right:1px solid #A6C218;">&nbsp;&nbsp;<?=$team1->club_id."&nbsp;&nbsp;".$team1->team_name?></td>

                                        	<td style="border-right:1px solid #A6C218;">&nbsp;&nbsp;<?=$team2->club_id."&nbsp;&nbsp;".$team2->team_name?></td>

                                        	<td>&nbsp;&nbsp;<?=$team3->club_id."&nbsp;&nbsp;".$team3->team_name?></td>

                                        </tr>

                                        <?php

                                                }

                                        	}

                                        ?>

									</table>

								</td>

							</tr>

							<tr>

                            	<td><strong>Belangrijk : de einddatum voor het opgeven van het aantal ploegen is verplaatst van

                            	15/11 naar 30/11.</strong></td>

							</tr>

						</table>

					</td>

				</tr>

				<tr>

			</table>

		</td>

	</tr>

</table>



</body>

</html>

